package lesson17.cars;

public class Car {
	
	protected String model;
	private double maxSpeed = 230;
	protected double currentSpeed;
	protected int currentGear;
	protected int numberOfDoors;
	private int idNUmber;
	protected boolean isSportCar;
	protected Person owner;
	
	protected String type = "Just a car";
	
	void changeOwner(Person newOwner)
	{
		this.owner = newOwner;
	}
	
	void startEngine()
	{
		this.currentSpeed = 1;
	}
	
	void chnageGear(int gear)
	{
		this.currentGear = gear;
	}
	
	protected void accelerate(double speed)
	{
		if(this.currentSpeed + speed > maxSpeed)
			this.currentSpeed = maxSpeed;
		else
			this.currentSpeed = this.currentSpeed + speed;
		System.out.println("Now driving with: " + maxSpeed);
	}
	
	Car (double maxSpeed)
	{
		this.maxSpeed = maxSpeed;
	}

	@Override
	public String toString() {
		return model.toString();
	}
	
}
